package sz.com.battleship.game;


import sz.com.battleship.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class GameMenu extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
	Button SPButton = null;
	Button MPButton = null;
	Button ExitButton = null;
	public static boolean singlePlayer = true;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_menu);
        ExitButton = (Button) findViewById (R.id.buttonExit);
        ExitButton.setOnClickListener(this);
        SPButton = (Button) findViewById (R.id.buttonSinglePlayer);
        SPButton.setOnClickListener(this);
        MPButton = (Button) findViewById (R.id.buttonMultiplayer);
        MPButton.setOnClickListener(this);
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if(v.getId() == R.id.buttonSinglePlayer)
		{
			singlePlayer = true;
			Intent myIntent = new Intent(v.getContext(), GameScreen.class);
            startActivity(myIntent);
		}
		else if(v.getId() == R.id.buttonMultiplayer)
		{
			singlePlayer = false;
			Intent myIntent = new Intent(v.getContext(), MenuMulti.class);
            startActivityForResult(myIntent, 0);
		}
		else if(v.getId() == R.id.buttonExit)
		{
			this.finish();
		}
	}
}